package com.ninetaildemonfox.zdl.socialproject.mvp.ui.fragment.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ninetaildemonfox.zdl.socialproject.R;

import java.util.Map;

/**
 * 创建人： Nine tails fox
 * 创建时间： 2019/7/22
 * 功能描述：
 * 联系方式：1037438704@qq.com
 *
 * @author NineTailDemonFox
 */

public class AccountDetailsAdapter extends BaseQuickAdapter<Map<String, String>, BaseViewHolder> {


    public AccountDetailsAdapter(int list_fragment_account_adp) {
        super(list_fragment_account_adp);
    }

    @Override
    protected void convert(BaseViewHolder helper, Map<String, String> item) {

        String income = item.get("income");
// 收入支出 1收入 2支出
        if (income.equals("1")) {
            income = "+";
        } else {
            income = "-";
        }
        helper.setText(R.id.text_title, item.get("name"))
                .setText(R.id.text_time, item.get("create_time"))
                .setText(R.id.text_money, income + item.get("money"));
    }
}
